package cn.catsdad.page;

import cn.catsdad.base.page.PageParam;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.HashMap;
import java.util.Map;

/**
 * 常量明细查询
 *
 * @author xuyonglong
 * @version V1.0 2023/5/6
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class DictDetailParam extends PageParam {

    private Map<String, Object> param = new HashMap<>();

    /**
     * 常量id
     */
    private Long dictId;

    @Override
    public Map<String, Object> getParamMap() {
        return this.param;
    }

    @Override
    public String getCondition() {
        StringBuilder condition = new StringBuilder(" and d.isDeleted = 0 ");
        if (this.dictId != null) {
            condition.append(" and d.dictId = :dictId");
            this.param.put("dictId", this.dictId);
        }
        return condition.toString();
    }
}
